package com.company.example.generator;

import com.mybatis.generate.generator.GeneratorFacade;

import java.util.Map;

public class GeneratorMain {
	private static String rootPath;
	static {
		String classPath = GeneratorMain.class.getResource("/").getPath();
		rootPath = classPath.substring(0,classPath.indexOf("/target/classes/"));
	}
	public static void main(String[] args) throws Exception {
		GeneratorFacade g = new GeneratorFacade("com/company/example/config/generator_config.xml", rootPath);
		
		for (Map.Entry<String, Object> entry : g.tableMaps.entrySet()) {
			g.generateByTable(entry.getKey(), entry.getValue().toString());
		}
	}
}
